Skip to content

Add user access check for panel visibility in PanelSwitch#58

Closed
Yismen wants to merge 1 commit intobezhanSalleh:mainfrom
Yismen:main
Closed

Add user access check for panel visibility in PanelSwitch#58
Yismen wants to merge 1 commit intobezhanSalleh:mainfrom
Yismen:main

Conversation

@Yismen
Copy link
Copy Markdown

@Yismen Yismen commented Jan 24, 2026

Add the ability to exclude any panel where the user does not pass the canAccessPanel's check

Add the ability to exclude any panel where the user does not pass the canAccessPanel's check
Comment thread composer.json Outdated
@bezhanSalleh
Copy link
Copy Markdown
Owner

bezhanSalleh commented Feb 7, 2026

This check is already built-in.
We have documented as visibility. Unless I'm missing something?

@Yismen
Copy link
Copy Markdown
Author

Yismen commented Feb 7, 2026

The current implementation hides the full switch option from totally unauthorized users, which is great.

With this pull request, we continue to display the switcher to those who pass the authorization check, but we only present the links for the panels they are permitted to access., based on the canAccessPanel method. It intents to ensure that panels such as admin or any others that they should not even know about remain hidden from standard users in the application.

Current Implementation
image

Intended with this PR
image

@bezhanSalleh bezhanSalleh mentioned this pull request Feb 8, 2026
Merged
@bezhanSalleh
Copy link
Copy Markdown
Owner

bezhanSalleh commented Feb 8, 2026

Thanks for the PR. I had a look into the core after you explained your use-case then I improved upon your idea which lead to #60.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants